import { Entity, CreateDate, UpdateDate, PrimaryUuid, Unique, WxMGroupId, Remark, Openid, DynamicPermission, Nickname, Mobile, Email, Password, Salt, Avatar, Boolean, Gender, Country, Province, City, Tags, Digdit, CreateUserId, Code, Realname, Uuid, Cover } from '@sker/core'
/**
 * 系统会员
 */
@Entity({
    name: 'wx_member'
})
export class WxMember {
    static title: string = `会员`;
    static resource: string = `wx_member`;

    @PrimaryUuid({
        type: 'uuid',
        comment: '会员编号',
        primaryKeyConstraintName: "PK_WX_MEMBER_ID"
    })
    id!: string;

    @Code({ comment: '所属小程序', nullable: true })
    appid: string;

    @Openid({
        comment: 'openid',
        default: ''
    })
    openid!: string;

    @Openid({
        comment: 'unionid',
        nullable: true,
        default: ''
    })
    unionid!: string;

    @DynamicPermission({ comment: '权限', nullable: true, default: [] })
    permissions!: any;

    @Cover({ comment: '身份证正面', nullable: true })
    card_zheng: string;

    @Cover({ comment: '身份证反面', nullable: true })
    card_fan: string;

    @Boolean({ comment: '是否已实名', default: false })
    has_realname: boolean;

    @Nickname({
        comment: '昵称',
        default: ''
    })
    nickname!: string;

    @Mobile({ comment: '手机号', default: '' })
    mobile!: string;

    @Email({ comment: '邮箱', default: '' })
    email!: string;

    @Password({ comment: '密码', default: '' })
    password!: string;

    @Salt({ comment: '加密盐', default: '' })
    salt!: string;

    @Avatar({
        comment: '头像',
        default: ''
    })
    avatar!: string;

    @Boolean({
        comment: '会员状态',
        default: false,
        label: '状态'
    })
    status!: boolean;

    @Boolean({ default: false, nullable: true, label: '是否在线', comment: '是否在线' })
    online: boolean;

    @Gender({
        comment: '性别',
        default: 'unknown'
    })
    gender!: string;

    @Country({ comment: '国家', default: '中国' })
    country!: string;

    @Province({ comment: '省份', default: '' })
    province!: string;

    @City({ comment: '城市', default: '' })
    city!: string;

    @Tags({
        comment: '标签',
        default: []
    })
    tags!: string[]

    @Remark({ default: '' })
    remark!: string;

    @Code({ label: '邀请码', default: '' })
    code: string;

    @Realname({ label: '姓名', default: '' })
    realname: string;

    @Digdit({ type: 'integer', comment: '积分1', width: 11, default: 0 })
    credit1!: number;

    @Digdit({ type: 'integer', comment: '积分2', width: 11, default: 0 })
    credit2!: number;

    @Digdit({ type: 'integer', comment: '积分3', width: 11, default: 0 })
    credit3!: number;

    @Digdit({ type: 'integer', comment: '积分4', width: 11, default: 0 })
    credit4!: number;

    @Digdit({ type: 'integer', comment: '积分5', width: 11, default: 0 })
    credit5!: number;

    @Digdit({ type: 'integer', comment: '积分6', width: 11, default: 0 })
    credit6!: number;

    @CreateUserId({ type: 'uuid', comment: '创建人', nullable: true })
    create_uid!: string;

    @WxMGroupId({ type: 'uuid', comment: '会员组' })
    group_id!: string;

    @CreateDate({
        comment: '创建日期'
    })
    create_date!: Date;

    @UpdateDate({
        comment: '更新日期'
    })
    update_date!: Date;
}